//**************************************************************************************
// Copyright 2003 Micron Technology, Inc. All rights reserved.
//
//
// No permission to use, copy, modify, or distribute this software and/or
// its documentation for any purpose has been granted by Micron Technology, Inc.
// If any such permission has been granted ( by separate agreement ), it
// is required that the above copyright notice appear in all copies and
// that both that copyright notice and this permission notice appear in
// supporting documentation, and that the name of Micron Technology, Inc. or any
// of its trademarks may not be used in advertising or publicity pertaining
// to distribution of the software without specific, written prior permission.
//
//
//	This software and any associated documentation are provided AS IS and 
//	without warranty of any kind.   MICRON TECHNOLOGY, INC. EXPRESSLY DISCLAIMS 
//	ALL WARRANTIES EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO, NONINFRINGEMENT 
//	OF THIRD PARTY RIGHTS, AND ANY IMPLIED WARRANTIES OF MERCHANTABILITY OR FITNESS 
//	FOR A PARTICULAR PURPOSE.  MICRON DOES NOT WARRANT THAT THE FUNCTIONS CONTAINED 
//	IN THIS SOFTWARE WILL MEET YOUR REQUIREMENTS, OR THAT THE OPERATION OF THIS SOFTWARE 
//	WILL BE UNINTERRUPTED OR ERROR-FREE.  FURTHERMORE, MICRON DOES NOT WARRANT OR 
//	MAKE ANY REPRESENTATIONS REGARDING THE USE OR THE RESULTS OF THE USE OF ANY 
//	ACCOMPANYING DOCUMENTATION IN TERMS OF ITS CORRECTNESS, ACCURACY, RELIABILITY, 
//	OR OTHERWISE.  
//*************************************************************************************/
//
// $Revision: 1.5 $
// $Date: 2004/03/17 02:39:08 $ 
//
// The sensor data file should adhere to the following form.  Note that
// all of the fields in the chip descriptor section are required. 
// The register section contains certain known registers and additional
// registers which are not predefined. The current known registers are:
//     CHIP_VERSION_REG
//     RESET_REG
//     GREEN1_GAIN_REG
//     BLUE_GAIN_REG
//     RED_GAIN_REG
//     GREEN2_GAIN_REG
//     HORZ_BLANK_REG 
//     INTEG_TIME_REG
//     VREF_REG 
//
// [CHIP_DESCRIPTOR]
//    SENSORNAME = "string"
//    WIDTH = integer
//    HEIGHT = integer
//    IMAGE_TYPE = BAYER
//    BITS_PER_CLOCK = integer
//    CLOCKS_PER_PIXEL = integer
//    PIXEL_CLOCK_POLARITY = 0/1
//    SHIP_BASE_ADDRESS = hex
// [END]
//
// [OPTIONAL]
//    PART_NUMBER = "string"
//    EXTRA_DESC_REG = register
//    SENSOR_VERSION = integer
// [END]
//
// [REGISTERS]
//    REGDEF = {hex, CORE/IP, hex, RW/RO, hex, "string", "string", "string"}
//      {BITDEF, hex, RW/RO, "string", "string"}
//      {BITDEF, hex, RW/RO, "string", "string"}
//      ...
//      {BITDEF, hex, RW/RO, "string", "string"}
// [END]
//

[CHIP_DESCRIPTOR]
SENSORNAME = "MI-1300"
WIDTH = 1280
HEIGHT = 1024
IMAGE_TYPE = BAYER
BITS_PER_CLOCK = 10
CLOCKS_PER_PIXEL = 1
PIXEL_CLOCK_POLARITY = 0
SHIP_BASE_ADDRESS = 0xBA
[END]

[OPTIONAL]
PART_NUMBER = "MT9M001"
SENSOR_VERSION = 3
[END]

//REGDEF =                     {ADDR, TYPE, MASK,   RW, DEFAULT, DESC, DETAIL}
//  {BITDEF,                                MASK,   RW,          DESC, DETAIL}
//  {BITDEF,                                MASK,   RW,          DESC, DETAIL}
//  ...
//  {BITDEF,                                MASK,   RW,          DESC, DETAIL}

[REGISTERS]
CHIP_VERSION_REG =             {0x00, CORE, 0xFFFF, RO, 0x8431, "Chip Version", ""}
ROW_WINDOW_START_REG =         {0x01, CORE, 0x07FF, RW, 0x000C, "Row Window Start", ""}
COL_WINDOW_START_REG =         {0x02, CORE, 0x07FF, RW, 0x0014, "Column Window Start", "Must be Even Number (min 0x14)"}
ROW_WINDOW_SIZE_REG =          {0x03, CORE, 0x07FF, RW, 0x03FF, "Window Height", "Number of rows minus 1 (min 0x02)"}
COL_WINDOW_SIZE_REG =          {0x04, CORE, 0x07FF, RW, 0x04FF, "Window Width", "Number of columns minus 1"}
HORZ_BLANK_REG =               {0x05, CORE, 0x07FF, RW, 0x0009, "Horizontal Blanking", "Column Fill-in"}
VERT_BLANK_REG =               {0x06, CORE, 0x07FF, RW, 0x000F, "Vertical Blanking", ""}
CONTROL_MODE_REG =             {0x07, CORE, 0xFFFF, RW, 0x0002, "Output Control", ""}
    {SYNC,                                  0x0001, RW,         "0: Sync changes", "0: update changes immediately; 1: do not update till 0"}
    {CHIP_ENABLE,                           0x0002, RW,         "1: Chip Enable", "0: stops video output at end of current frame; 1: normal"}
    {CONTROL_MODE_BIT2,                     0x0004, RW,         "2: ADC test mode", "0: normal operation; 1: test mode operation"}
    {DGAIN_OVRD,                            0x0008, RW,         "3: Digital gain Override", "0: normal operation; 1: gain passed to gain switches"}
    {USE_TDATA,                             0x0040, RW,         "6: Override pixel data", "0: normal; 1: output data = value of test data register"}
INTEG_TIME_REG =               {0x09, CORE, 0x3FFF, RW, 0x0419, "Shutter Width", "Number of rows of integration"} 
RESTART_REG =                  {0x0B, CORE, 0x0001, RW, 0x0000, "Frame Restart", ""}
SHUTTER_DELAY_REG =            {0x0C, CORE, 0x07FF, RW, 0x0000, "Shutter Delay", ""}
RESET_REG =                    {0x0D, CORE, 0x0001, RW, 0x0000, "Reset", "0: Resume, 1: Reset"}
READ_MODE_1 =                  {0x1E, CORE, 0xFFFF, RW, 0x8000, "Read Options 1", ""}
    {BIT_0,                                 0x0001, RW,         "0: Reserved", "Set to 0"}
    {BIT_1,                                 0x0002, RW,         "1: Reserved", "Set to 0"}
    {COLUMN_SKIP_4,                         0x0004, RW,         "2: Col Skip 4", "1:enable"} 
    {ROW_SKIP_4,                            0x0008, RW,         "3: Row Skip 4", "1:enable"} 
    {COLUMN_SKIP_8,                         0x0010, RW,         "4: Col Skip 8", "1:enable"} 
    {ROW_SKIP_8,                            0x0020, RW,         "5: Row Skip 8", "1:enable"} 
    {SNAPSHOT_MODE,                         0x0100, RW,         "8: Snap Shot Mode", "0: continuous; 1:enable (wait for trigger)"} 
    {STROBE_ENABLE,                         0x0200, RW,         "9: Strobe enable", "0: no strobe (default); 1:enable"} 
    {STROBE_WIDTH,                          0x0400, RW,         "10: Strobe width", "0: default; 1:extend strobe width"} 
    {STROBE_OVERRIDE,                       0x0800, RW,         "11: Strobe override", "0: default; 1:override strobe signal"} 
READ_MODE_2 =                  {0x20, CORE, 0xFFFF, RW, 0x1104, "Read Options 2", ""} 
    {NO_BAD_FRAMES,                         0x0001, RW,         "0: No bad frames", "0: only good frames; 1: all frames"} 
    {OFFSET_ON,                             0x0004, RW,         "2: Reserved, "set to 1"} 
    {COLUMN_SKIP,                           0x0008, RW,         "3: Column skip", "0: normal readout; 1: read 2 rows, skip 2 cols"} 
    {ROW_SKIP,                              0x0010, RW,         "4: Row skip", "0: normal readout; 1: read 2 rows, skip 2 rows"} 
    {OFFSET_POST,                           0x0040, RW,         "6: Reserved", "set to 0"} 
    {FLIP_ROW,                              0x0080, RW,         "7: Readout 1 row later", "0: normal; 1: readout 1 row later"} 
    {OFFSET_PRE,                            0x0100, RW,         "8: Reserved", "set to 1"} 
    {LINE_VALID,                            0x0200, RW,         "9: Continuous line valid", "1: Produce Line Valid during Veritcal Blank"} 
    {XOR_LINE_VALID,                        0x0400, RW,         "10: xor line_valid", "1: Line valid = Line Valid XOR Frame Valid"} 
    {DARK_ROWS,                             0x0800, RW,         "11: Read dark rows", "1: all 14 dark rows read plus valid data"} 
    {MIRROR_COL,                            0x4000, RW,         "14: Reverse col output order", "0: Sensor reads right to left, 1: Left to right"} 
    {MIRROR_ROW,                            0x8000, RW,         "15: Reverse row output order", "0: Sensor reads top to bottom, 1: Bottom to top"} 
RESERVED_27 =                  {0x27, CORE, 0x01FF, RW, 0x000C, "Reserved", ""}
DAC_CONTROL_2_REG =            {0x29, CORE, 0x000F, RW, 0x0000, "Dac Control2", "Reserved, should not require modification"}
GREEN1_GAIN_REG =              {0x2B, CORE, 0x007F, RW, 0x0008, "Green1 Gain", ""}
    {GREEN1_GAIN_VALUE,                     0x003F, RW,         "0-5: Green1 Gain Value", ""}
    {GREEN1_GAIN_DOUBLE_1,                  0x0040, RW,         "6: Double Green1 Gain", "1: Multiply gain value by 2"}
BLUE_GAIN_REG =                {0x2C, CORE, 0x007F, RW, 0x0008, "Blue Gain", ""}
    {BLUE_GAIN_VALUE,                       0x003F, RW,         "0-5: Blue Gain Value", ""}
    {BLUE_GAIN_DOUBLE_1,                    0x0040, RW,         "6: Double Blue Gain", "1: Multiply gain value by 2"}
RED_GAIN_REG =                 {0x2D, CORE, 0x007F, RW, 0x0008, "Red Gain", ""}
    {RED_GAIN_VALUE,                        0x003F, RW,         "0-5: Red Gain Value", ""}
    {RED_GAIN_DOUBLE_1,                     0x0040, RW,         "6: Double Red Gain", "1: Multiply gain value by 2"}
GREEN2_GAIN_REG =              {0x2E, CORE, 0x007F, RW, 0x0008, "Green2 Gain", ""}
    {GREEN2_GAIN_VALUE,                     0x003F, RW,         "0-5: Green2 Gain value", ""}
    {GREEN2_GAIN_DOUBLE_1,                  0x0040, RW,         "6: Double gain", "1: Multiply gain value by 2"}
RESERVED_32 =                  {0x32, CORE, 0x03FF, RW, 0x0000, "Reserved", ""}
GLOBAL_GAIN_REG =              {0x35, CORE, 0x007F, RW, 0x0008, "Global Gain", ""}
    {GLOBAL_GAIN_VALUE,                     0x003F, RW,         "0-5: Global Gain value", ""}
    {GLOBAL_GAIN_DOUBLE_1,                  0x0040, RW,         "6: Double Global gain", "1: Multiply gain value by 2"}
RESERVED_3C =                  {0x3C, CORE, 0x00FF, RW, 0x0020, "Reserved", ""}
RESERVED_3D =                  {0x3D, CORE, 0x00FF, RW, 0x0003, "Reserved", ""}
RESERVED_3E =                  {0x3E, CORE, 0x00FF, RW, 0x0003, "Reserved", ""}
RESERVED_3F =                  {0x3F, CORE, 0x00FF, RW, 0x0003, "Reserved", ""}
RESERVED_40 =                  {0x40, CORE, 0x00FF, RW, 0x0003, "Reserved", ""}
RESERVED_41 =                  {0x41, CORE, 0x00FF, RW, 0x0003, "Reserved", ""}
RESERVED_42 =                  {0x42, CORE, 0x00FF, RW, 0x0003, "Reserved", ""}
RESERVED_43 =                  {0x43, CORE, 0x00FF, RW, 0x0003, "Reserved", ""}
RESERVED_45 =                  {0x45, CORE, 0x00FF, RW, 0x000C, "Reserved", ""}
RESERVED_46 =                  {0x46, CORE, 0x00FF, RW, 0x0014, "Reserved", ""}
RESERVED_47 =                  {0x47, CORE, 0x00FF, RW, 0x0020, "Reserved", ""}
RESERVED_48 =                  {0x48, CORE, 0x00FF, RW, 0x0038, "Reserved", ""}
RESERVED_4A =                  {0x4A, CORE, 0x00FF, RW, 0x0010, "Reserved", ""}
RESERVED_4E =                  {0x4E, CORE, 0x00FF, RW, 0x0020, "Reserved", ""}
RESERVED_4F =                  {0x4F, CORE, 0x00FF, RW, 0x0008, "Reserved", ""}
CAL_THRESHOLD =                {0x5F, CORE, 0xFFFF, RW, 0x0904, "Black Level Threshold", ""}
    {CAL_THRESHOLD_MIN,                     0x003F, RW,         "0-5: Min Black Level", "Lower threshold for black level in ADC LSBs"}
    {CAL_THRESHOLD_AUTO,                    0x0080, RW,         "7: Use Threshold", "0: Auto threshold adjustment; 1: Override auto adj"}
    {CAL_THRESHOLD_MAX,                     0x7F00, RW,         "8-14: Maximum Black Level", "Max allowed black leven in ADC LSBs"}
    {NO_GD_THRES,                           0x8000, RW,         "15: No Gain dependence", ""}
CAL_G1 =                       {0x60, CORE, 0x01FF, RW, 0x0000, "Cal Green1", ""}
CAL_G2 =                       {0x61, CORE, 0x01FF, RW, 0x0000, "Cal Green2", ""}
CAL_CTRL =                     {0x62, CORE, 0xFFFF, RW, 0x0498, "Cal Control", ""}
    {USE_SET_CALIB_VALS,                    0x0001, RW,         "0: Manual override", "1: override auto black level with programmed vals"}
    {CALIB_1_2,                             0x0006, RW,         "1-2: Force/Disable calib", "00: default; 01: continuous; 1x: disable"}
    {RESERVED_3_8,                          0x01F8, RW,         "3-8: Reserved", ""} 
    {NO_RECLC_THRESH,                       0x0800, RW,         "11: No reclc threshold", "0: default; 1: do not reset threshold"} 
    {RESYNC_BL,                             0x1000, RW,         "12: Resync BL", "0: normal; 1: start new average"} 
    {RESERVED_13_14,                        0x6000, RW,         "13-14: Reserved", ""} 
    {NO_BP_LOCAL,                           0x8000, RW,         "15: No Bp local", "0: normal; 1: do not perform black level sweep"} 
CAL_R =                        {0x63, CORE, 0x01FF, RW, 0x0000, "Cal Red", ""}
CAL_B =                        {0x64, CORE, 0x01FF, RW, 0x0000, "Cal Blue", ""}
CLOCK_CTRL_REG =               {0x65, CORE, 0x0003, RW, 0x0000, "Power Reg", "Do not modify"}
    {SHIP,                                  0x0001, RW,         "0: Two-wire clock", ""} 
    {DARK,                                  0x0002, RW,         "1: Black level calib clock", ""}
CHIP_ENABLE_REG =              {0xF1, CORE, 0x0003, RW, 0x0001, "Chip Enable", ""}
    {CHIP_ENABLE,                           0x0001, RW,         "0: CE", "Mirrors functionality of Reg07 bit 1"} 
    {SYNC,                                  0x0002, RW,         "1: Synchronize changes", "Mirrors functionality of Reg07 bit 0"}
[END]